<table lay-filter="layerTable"  lay-skin="line">
    <thead>
      <tr>
        <th class="xutd" lay-data="{field:'xutdId', width:60,fixed:'left'}">序号</th>
        <th lay-data="{field:'articleNo'}">文章编号</th>
		<th lay-data="{field:'typeId'}">文章类型</th>
		<th lay-data="{field:'title'}">标题</th>
		<th lay-data="{field:'briefs'}">简介</th>
		<th lay-data="{field:'viewNum'}">阅读量</th>
		<th lay-data="{field:'modifyTime'}">更新时间</th>
        <th lay-data="{field:'setting', width:150,fixed:'right'}">操作</th>
      </tr>
    </thead>
    <tbody>
      <#list pager.records as item>
	      <tr>
	        <td>${(item_index+1)+pager.size*(pager.current-1)}</td>
            <td>${item.articleNo}</td>
            <td>${item.typeName}</td>
            <td>${item.title}</td>
            <td>${item.briefs}</td>
            <td>${item.viewNum}</td>
            <td>${item.modifyTime?string("yyyy-MM-dd HH:mm:ss")}</td>
            <td>
                  <@shiro.hasPermission name="sysman:HELPME_SYSTEM:update">
                      <button class="layui-btn layui-btn-small editBtn" type="button" data-id="${item.id}" onclick="toEdit(this);">
                          <i class="layui-icon" title="编辑">&#xe642;</i>
                      </button>
                  </@shiro.hasPermission>
                  <@shiro.hasPermission name="sysman:HELPME_SYSTEM:delete">
                      <button class="layui-btn layui-btn-small layui-btn-danger delBtn" type="button" data-id="${item.id}" onclick="toDel(this);">
                          <i class="layui-icon" title="删除">&#xe640;</i>
                      </button>
                  </@shiro.hasPermission>
            </td>
          </tr>
      </#list>
    </tbody>
  </table>
  <script type="text/javascript">
      var pagesize = ${pager.size};
      layui.use(['table', 'laypage'], function(){
          var table = layui.table;
          //转换静态表格
          table.init('layerTable', {
              height: $(window).height() - 200, //设置高度,
              limit:${pager.size}
          });
          var laypage = layui.laypage;
          //执行一个laypage实例
          laypage.render({
              elem: 'layer-page' //注意，这里的 test1 是 ID，不用加 # 号
              ,limits:[20,40,60,80,100,200]
              ,limit:${pager.size}
              ,curr:${pager.current}
              ,count: ${pager.total} //数据总数，从服务端得到
              ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
              ,jump: function(obj, first){
                  console.log(obj.curr);
                  console.log(obj.limit);
                  //首次不执行
                  if(!first){
                      baseSearchQueryLayer(obj.curr,obj.limit);
                      //转换静态表格
                  }
              }
          });

          window.onresize = function() {
              //转换静态表格
              table.init('layerTable', {
                  height: $(window).height() - 200, //设置高度,
                  limit:${pager.size}
              });
          }
      });
      function toEdit(obj){
          toBaseSelEdit(obj,false,$(window).width(),530,true);
      }
      function toDel(obj){
          baseSelDel(obj);
      }
  </script>
<#include "/common/page.ftl">